package org.example.server.service;

import org.example.api.UserApi;
import org.example.server.dao.UserDao;
import org.example.common.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * (User)表服务接口
 *
 * @author makejava
 * @since 2022-04-28 16:32:54
 */
@RestController
public class UserService implements UserApi {

   @Autowired
   private UserDao userDao;

    @Override
    public User getUserByName(String username) {
        return userDao.getByUsername(username);
    }

    @Override
    public int addUser(User user) {
        return userDao.insert(user);
    }

    public User queryById(Integer id) {
        return userDao.queryById(id);
    }
}